﻿Imports DevExpress.XtraEditors

Public Class PhieuNhap

    Private Sub PhieuNhap_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'GPPNhaThuocDataSet.DMHangHoa' table. You can move, or remove it, as needed.
        Me.DMHangHoaTableAdapter.Fill(Me.GPPNhaThuocDataSet.DMHangHoa)
        'TODO: This line of code loads data into the 'GPPNhaThuocDataSet.DMDoiTuong' table. You can move, or remove it, as needed.
        Me.DMDoiTuongTableAdapter.Fill(Me.GPPNhaThuocDataSet.DMDoiTuong)

    End Sub

    Public Sub New()
        InitializeComponent()
        Me.setSoTab(1)
        Me.setObj(Me.GPPNhaThuocDataSet, Me.GPPNhaThuocDataSet.DMDoiTuong, Me.DMDoiTuongBindingSource, Me.TableAdapterManager, Me.DMDoiTuongTableAdapter, Me.MadoituongITextEdit, Me.GhichuITextEdit)
        ' Me.setTab1(Me.GPPNhaThuocDataSet.DMHangHoa, Me.FKDMHangHoaDMDoituongBindingSource, Me.DMHangHoaTableAdapter)
    End Sub
    Public Overrides Sub setSubSau_TaoMoi()
        Me.setMacDinhCotAn("ma", System.Guid.NewGuid())
    End Sub

    Private Sub RepositoryItemSearchLookUpEdit1_EditValueChanging(sender As Object, e As DevExpress.XtraEditors.Controls.ChangingEventArgs) Handles RepositoryItemSearchLookUpEdit1.EditValueChanging
        Dim editor As SearchLookUpEdit = CType(sender, SearchLookUpEdit)
        Dim rowHandle As Integer = editor.Properties.GetIndexByKeyValue(e.NewValue)
        IGridViewChiTiet01.SetFocusedRowCellValue("mahang", editor.Properties.View.GetRowCellValue(rowHandle, "ma"))
        IGridViewChiTiet01.SetFocusedRowCellValue("tenhang", editor.Properties.View.GetRowCellValue(rowHandle, "ten"))
        IGridViewChiTiet01.SetFocusedRowCellValue("dvt", editor.Properties.View.GetRowCellValue(rowHandle, "donvitinh"))

    End Sub
End Class
